Skip to main content

Initialize Payment Collection

Initiate a payment request to generate a unique payment reference, payment code and checkout URL for your customers

POST https://api.spotflow.co/api/v1/payments/initialize

Headers

authorization
String

Bearer SECRET_KEY
Include your secret key in the request header as a Bearer token for authorization. Unauthorized requests will result in a 401 HTTP status code.

content-type
String
application/json

Body Parameters

reference
String

Specify a unique reference ID generated by your company to identify each customer.

amount
Integer
Amount should be in the subunit of our supported currency i.e your local currency or USD.
currency
String
Select the currency for the charges. Can either be in USD or in the local currency of your collection region.
customer email
String
The customer’s email address

Sample Request Body

{
"reference": "ref-{{$randomUUID}}",
"amount": 5000,
"currency": "NGN",
"customer": {
"email": "customer@email.com"
}
}

Sample Response

200 OK

{
"reference": "ref-17d73b59-69ce-4499-891a-7932e7933890",
"checkoutUrl": "https://checkout.spotflow.co/B6vnktDvISo",
"paymentCode": "B6vnktDvISo",
"status": "pending"
}

Confirm the payment collection outcome via the webhook URL set up on your dashboard or by using our Verify Payment Collection Endpoint.